package com.jacobson.core.framework.repository

import android.app.Application
import android.content.Context
import dagger.Lazy
import retrofit2.Retrofit
import javax.inject.Inject
import javax.inject.Singleton

/**
 * ================================================
 *
 *  @author Wucz on 2018/7/23 9:27
 * ================================================
 */

@Singleton
class RepositoryManager @Inject constructor() : IRepositoryManager {
    @Inject
    internal lateinit var retrofit: Lazy<Retrofit>
    @Inject
    internal lateinit var application: Application


    override fun <T> obtainRetrofitService(service: Class<T>): T {
        return retrofit.get().create(service)
    }

    override fun <T> obtainCacheService(cache: Class<T>): T {
        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
    }

    override fun clearAllCache() {
        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
    }

    override fun getContext(): Context = application
}
